package org.nanotek.mq.receive;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

import org.nanotek.util.Base;
import org.springframework.stereotype.Component;

@Component
public class BaseListener implements MessageListener
{

	public void onMessage( final Message message )
	{
		ObjectMessage textMessage = (ObjectMessage)message;
		
		try
		{
			System.out.println( "THIS IS THE JMS TYPE " + textMessage.getJMSType() );
			Base<?> index = (Base<?>) textMessage.getObject();
			System.out.println( "THIS IS OBJECT ID " + index.getId());
			
		}
		catch (final JMSException e)
		{
			e.printStackTrace();
		}
	}

}
